#include <iostream>
#include <string>
#include <vector>
/*
版本：1.0_alpha1
原理：借助string和高精度算法进行大数封装。
当前版本缺陷：无法使用int，long int, long long int, unsigned int, unsigned long long int等直接赋值
*/
class BigInteger
{
private:
    std::string arr; //string模拟数字
    size_t length; //数字长度，主要用于后续加减乘除法计算
public:
    BigInteger(int num);
    BigInteger(std::string num);
    BigInteger();

    std::string getValue();
    void setValue(std::string num);

    BigInteger max(BigInteger X, BigInteger Y);
    BigInteger min(BigInteger X, BigInteger Y);
    BigInteger abs() const;

    const bool operator< (const BigInteger& args) const;
    const bool operator> (const BigInteger& args) const;
    void operator= (const std::string args);
    const bool operator== (const BigInteger& args) const;
    const bool operator<= (const BigInteger& other) const;
    const bool operator>= (const BigInteger& other) const;
    const bool operator!= (const BigInteger& args) const;

    friend std::ostream& operator<<(std::ostream& os, const BigInteger& data);
    friend std::istream& operator>>(std::istream& is, BigInteger& data);

    inline std::string unsigned_add (std::string a, std::string b) const;
    inline std::string unsigned_sub(std::string a, std::string b) const;
    inline int compare_unsigned(const std::string& a, const std::string& b) const;

    const BigInteger operator+ (const BigInteger& args) const;
    const BigInteger operator- (const BigInteger& args) const;
    const BigInteger operator* (const BigInteger& args) const;
    const BigInteger operator/ (const BigInteger& divisor) const;
    const BigInteger operator% (const BigInteger& divisor) const;
    BigInteger& operator++();
    BigInteger operator++(int);
    BigInteger& operator--();
    BigInteger operator--(int);
    BigInteger& operator+=(const BigInteger& other);
    BigInteger& operator-=(const BigInteger& other);
    BigInteger& operator*=(const BigInteger& other);
    BigInteger& operator/=(const BigInteger& other);
    BigInteger& operator%=(const BigInteger& other);

    ~BigInteger(){}
};